package com.ruoyi.system.domain.bo;

import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 购物车业务对象 p_store_cart
 *
 * @author ruoyi
 * @date 2022-08-01
 */

@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("购物车业务对象")
public class PStoreCartBo extends BaseEntity {

    /**
     * 购物车表ID
     */
    @ApiModelProperty(value = "购物车表ID", required = true)
    @NotNull(message = "购物车表ID不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID", required = true)
    private Long uid;

    /**
     * 类型
     */
    @ApiModelProperty(value = "类型", required = true)
    private String type;

    /**
     * 商品ID
     */
    @ApiModelProperty(value = "商品ID", required = true)
    @NotNull(message = "商品ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long productId;

    /**
     * 商品属性
     */
    @ApiModelProperty(value = "商品属性", required = true)
    private String productAttrUnique;

    /**
     * 商品数量
     */
    @ApiModelProperty(value = "商品数量", required = true)
    @NotNull(message = "商品数量不能为空", groups = { AddGroup.class, EditGroup.class })
    @Min(value = 1, message = "商品数量不能小于1")
    @Max(value = 99, message = "单个商品数量不能大于99")
    private Integer cartNum;

    /**
     * 是否为立即购买 0 否 1 是
     */
    @ApiModelProperty(value = "是否为立即购买", required = true)
    private String isNew;

    /**
     * 拼团id
     */
    @ApiModelProperty(value = "拼团id", required = true)
    private Long combinationId;

    /**
     * 秒杀商品ID
     */
    @ApiModelProperty(value = "秒杀商品ID", required = true)
    private Long seckillId;

    /**
     * 砍价id
     */
    @ApiModelProperty(value = "砍价id", required = true)
    private Long bargainId;

    /**
     * 购物车状态
     */
    @ApiModelProperty(value = "购物车状态", required = true)
    private Integer status;


}
